package com.ruoyi.voucher.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.voucher.mapper.SummaryMapper;
import com.ruoyi.voucher.domain.Summary;
import com.ruoyi.voucher.service.ISummaryService;

/**
 * 摘要Service业务层处理
 * 
 * @author 孙帆科
 * @date 2025-02-24
 */
@Service
public class SummaryServiceImpl implements ISummaryService 
{
    @Autowired
    private SummaryMapper summaryMapper;

    /**
     * 查询摘要
     * 
     * @param summaryId 摘要主键
     * @return 摘要
     */
    @Override
    public Summary selectSummaryBySummaryId(Long summaryId)
    {
        return summaryMapper.selectSummaryBySummaryId(summaryId);
    }

    /**
     * 查询摘要列表
     * 
     * @param summary 摘要
     * @return 摘要
     */
    @Override
    public List<Summary> selectSummaryList(Summary summary)
    {
        return summaryMapper.selectSummaryList(summary);
    }

    /**
     * 新增摘要
     * 
     * @param summary 摘要
     * @return 结果
     */
    @Override
    public int insertSummary(Summary summary)
    {
        summary.setCreateTime(DateUtils.getNowDate());
        return summaryMapper.insertSummary(summary);
    }

    /**
     * 修改摘要
     * 
     * @param summary 摘要
     * @return 结果
     */
    @Override
    public int updateSummary(Summary summary)
    {
        return summaryMapper.updateSummary(summary);
    }

    /**
     * 批量删除摘要
     * 
     * @param summaryIds 需要删除的摘要主键
     * @return 结果
     */
    @Override
    public int deleteSummaryBySummaryIds(Long[] summaryIds)
    {
        return summaryMapper.deleteSummaryBySummaryIds(summaryIds);
    }

    /**
     * 删除摘要信息
     * 
     * @param summaryId 摘要主键
     * @return 结果
     */
    @Override
    public int deleteSummaryBySummaryId(Long summaryId)
    {
        return summaryMapper.deleteSummaryBySummaryId(summaryId);
    }

    @Override
    public List<Summary> sreachSummaryList() {
        return summaryMapper.sreachSummaryList();
    }
}
